<?php

namespace Account\Model;

use Common\Model\BaseModel;
use Common\Model\ModelException;

class GoldLogModel extends BaseModel
{
    protected $_auto = [
        ['create_time', 'time', self::MODEL_INSERT, 'function'],
    ];

    protected $_validate = [
    ];

    protected $_scope = [
    ];
    
    /*
     * 
     * user_id 用户id
     * mark  中文记录
     * gold  金币
     * add_time   增加时间
     * type  cost,send,chrage,vip,year_vip,
     * bid   书的id
     */
    public function addGoldLog($data) {
        $GoldLogModel = D('GoldLog');
        if(!empty($data) && $GoldLogModel->create($data)){
            $GoldLogModel->comment('金币记录')->add();
            return TRUE;
        }
    }

}
